--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 181ae3662760bdb72e5a24e45891f244ffc31aa7
Parents : a98bb9e
Author : Ivan <ivan@quad4.io>
Signature : Invalid signer <e46112d44649266d71fe2193e00a4710>, author is <ivan@quad4.io>
Date : 2026-07-09T11:54:04-05:00
refactor: format code
Changes
6 files changed, 18 insertions(+), 21 deletions(-)
Diff
diff --git a/meshchatx/src/backend/memory_pressure.py b/meshchatx/src/backend/memory_pressure.py
index acf711a0..46baf94c 100644
--- a/meshchatx/src/backend/memory_pressure.py
+++ b/meshchatx/src/backend/memory_pressure.py
@@ -8,7 +8,11 @@ import logging
import time
from typing import Any
-from meshchatx.src.backend import nomadnet_downloader, reticulum_pathfinding, rns_link_manager
+from meshchatx.src.backend import (
+ nomadnet_downloader,
+ reticulum_pathfinding,
+ rns_link_manager,
+)
_log = logging.getLogger("meshchatx.memory_pressure")
diff --git a/meshchatx/src/backend/nomadnet_downloader.py b/meshchatx/src/backend/nomadnet_downloader.py
index 43f01b2d..320a4290 100644
--- a/meshchatx/src/backend/nomadnet_downloader.py
+++ b/meshchatx/src/backend/nomadnet_downloader.py
@@ -89,7 +89,9 @@ def sweep_stale_links():
to_teardown.append(nomadnet_cached_links.pop(oldest_key, None))
_nomadnet_link_last_used.pop(oldest_key, None)
- orphans = [k for k in _nomadnet_link_last_used if k not in nomadnet_cached_links]
+ orphans = [
+ k for k in _nomadnet_link_last_used if k not in nomadnet_cached_links
+ ]
for k in orphans:
del _nomadnet_link_last_used[k]
_teardown_links(to_teardown)
@@ -103,9 +105,7 @@ def _cache_link_if_active(destination_hash: bytes, link) -> None:
nomadnet_cached_links[destination_hash] = link
_nomadnet_link_last_used[destination_hash] = time.time()
while len(nomadnet_cached_links) > MAX_CACHED_LINKS:
- candidates = [
- k for k in nomadnet_cached_links if k != destination_hash
- ]
+ candidates = [k for k in nomadnet_cached_links if k != destination_hash]
if not candidates:
break
oldest_key = min(
diff --git a/meshchatx/src/backend/recovery/health_monitor.py b/meshchatx/src/backend/recovery/health_monitor.py
index f0acf769..204e150a 100644
--- a/meshchatx/src/backend/recovery/health_monitor.py
+++ b/meshchatx/src/backend/recovery/health_monitor.py
@@ -126,12 +126,9 @@ class HealthMonitor:
},
)
self._trigger_memory_pressure(available_mb)
- elif (
- self._memory_pressure_active
- and self._consecutive_above(
- self._mem_available_history,
- self.MEMORY_RECOVER_MB,
- )
+ elif self._memory_pressure_active and self._consecutive_above(
+ self._mem_available_history,
+ self.MEMORY_RECOVER_MB,
):
self._recover_memory_pressure()
diff --git a/meshchatx/src/backend/reticulum_pathfinding.py b/meshchatx/src/backend/reticulum_pathfinding.py
index 66d8316d..5744a5b4 100644
--- a/meshchatx/src/backend/reticulum_pathfinding.py
+++ b/meshchatx/src/backend/reticulum_pathfinding.py
@@ -164,7 +164,9 @@ def clean_rns_announce_cache() -> bool:
"""Ask RNS to trim on-disk announce cache files not referenced by paths."""
try:
owner = getattr(RNS.Transport, "owner", None)
- if owner is not None and getattr(owner, "is_connected_to_shared_instance", False):
+ if owner is not None and getattr(
+ owner, "is_connected_to_shared_instance", False
+ ):
return False
clean = getattr(RNS.Transport, "clean_cache", None)
if callable(clean):
diff --git a/meshchatx/src/backend/self_check.py b/meshchatx/src/backend/self_check.py
index de43224f..09212356 100644
--- a/meshchatx/src/backend/self_check.py
+++ b/meshchatx/src/backend/self_check.py
@@ -707,18 +707,14 @@ def check_plugins_runtime(app: Any) -> dict[str, str]:
if not plugins_enabled:
return _status(True)
bundled_id = "com.meshchatx.mesh-observatory"
- if any(
- isinstance(item, dict) and item.get("id") == bundled_id for item in plugins
- ):
+ if any(isinstance(item, dict) and item.get("id") == bundled_id for item in plugins):
return _status(True)
try:
manager.install_bundled_examples()
plugins = manager.list_plugins()
except Exception as exc:
return _status(False, f"install_bundled_examples failed: {exc}")
- if any(
- isinstance(item, dict) and item.get("id") == bundled_id for item in plugins
- ):
+ if any(isinstance(item, dict) and item.get("id") == bundled_id for item in plugins):
return _status(True)
return _status(False, f"bundled plugin {bundled_id} missing after install")
diff --git a/tests/backend/test_sideband_plugin_loader.py b/tests/backend/test_sideband_plugin_loader.py
index c19638cc..8921476f 100644
--- a/tests/backend/test_sideband_plugin_loader.py
+++ b/tests/backend/test_sideband_plugin_loader.py
@@ -8,9 +8,7 @@ import RNS
from meshchatx.src.backend.plugin_rsg import create_rsg
from meshchatx.src.backend.sideband_plugin_loader import SidebandPluginLoader
-SIDEBAND_FIXTURES = (
- Path(__file__).resolve().parent / "fixtures" / "sideband_plugins"
-)
+SIDEBAND_FIXTURES = Path(__file__).resolve().parent / "fixtures" / "sideband_plugins"
class FakeConfigValue:
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────